{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1. 二重循环break与continue"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\t3\t5\t7\t9\t\n",
      "1\t3\t5\t7\t9\t\n",
      "1\t3\t5\t7\t9\t\n",
      "1\t3\t5\t7\t9\t\n",
      "1\t3\t5\t7\t9\t\n"
     ]
    }
   ],
   "source": [
    "# 二重循环中的break和continue用于控制本层循环\n",
    "# continue\n",
    "for i in range(5):\n",
    "    for j in range(1, 11):\n",
    "        if j % 2 == 0:\n",
    "            # break\n",
    "            continue\n",
    "        print(j, end='\\t')\n",
    "    print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "1\n",
      "1\n",
      "1\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "# break\n",
    "for i in range(5):\n",
    "    for j in range(1, 11):\n",
    "        if j % 2 == 0:\n",
    "            break\n",
    "        print(j)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.6.3",
   "language": "python",
   "name": "python3.6.3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
